import models.Component
import models.Computer
import models.CreateComponentRequest
import models.CreateComputerRequest

interface ObjectsRepository {
    // user
    suspend fun getMyComputers(): Result<List<Computer>>
    suspend fun getMyComponents(): Result<List<Component>>

    suspend fun verifyComputer(id: Int): Result<Boolean>
    suspend fun verifyComponent(id: Int): Result<Boolean>

    suspend fun computerBySerialNumber(serialNumber: String): Result<Computer>
    suspend fun componentBySerialNumber(serialNumber: String): Result<Component>

    suspend fun getComponentTypes(): Result<List<String>>

    // admin/moderator

    suspend fun getComputers(): Result<List<Computer>>
    suspend fun getComponents(): Result<List<Component>>

    suspend fun getComputer(id: Int): Result<Computer?>
    suspend fun getComponent(id: Int): Result<Component?>

    suspend fun getComputersByLocation(locationId: Int): Result<List<Computer>>
    suspend fun getComponentsByLocation(locationId: Int): Result<List<Component>>

    suspend fun getComponentsByComputer(computerId: Int): Result<List<Component>>

    suspend fun createComputer(computer: CreateComputerRequest): Result<Int>
    suspend fun createComponent(component: CreateComponentRequest): Result<Int>

    suspend fun updateComputer(id: Int, computer: CreateComputerRequest): Result<Boolean>
    suspend fun updateComponent(id: Int, component: CreateComponentRequest): Result<Boolean>

    suspend fun deleteComputer(id: Int): Result<Boolean>
    suspend fun deleteComponent(id: Int): Result<Boolean>
}